<template>
	<view class="page1">
		<view class="topVue">
			<view class="status"></view>
			<view class="navVue">
				<image src="../../static/imgs/back.png" style="width: 36rpx; height: 36rpx;" @click="backFun"></image>
				<view class="nav-title">分享收益</view>
				<view style="width: 36rpx; height: 36rpx;"></view>	
			</view>
		</view>
		<!-- <view class="place"></view> -->
		<view class="thVue">
			<text>用户</text>
			<text>分享收益</text>
		</view> 
		<view class="tdVue" v-for="(item, index) in list" :key="index">
			<text>{{item.fromName |conceal()}}</text>
			<text>{{item.amount}}USDT</text>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				list: [],
				pageNum: 1,
				pageSize: 30,
				isLastPage: false
			}
		},
		
		onReachBottom() {
			if(this.isLastPage) return
			this.pageNum++
			this.getList()
		},
		onLoad() {
			this.getList()
		},
		methods: {
			backFun(){
				uni.navigateBack({
					delta: 1
				})
			},
			getList(){
				this.$http
					.post(`/front/user/rewardList?pageNum=${this.pageNum}&pageSize=${this.pageSize}`)
					.then((res) => {
						console.log("ggggggggg", res);
						if (res.code === 0) {
							this.list = this.list.concat(res.obj.list);
							this.isLastPage = res.obj.isLastPage
						}
					})
					.catch((err) => {
						console.error(err);
					});
			}
		}
	}
</script>

<style lang="less" scoped>
	.tdVue {
		width: 690rpx;
		height: 80rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		text {
			font-size: 24rpx;
			color: #333;
		}
	}
	.thVue {
		width: 690rpx;
		height: 60rpx;
		background: #FFE3F0;
		border-radius: 4rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		text {
			font-size: 24rpx;
			color: #9F8C96;
		}
	}
	.page1 {
		width: 100%;
		height: 100%;
		// background: url("../../static/imgs/bg.png") no-repeat;
		// background-size: 100% 100%;
		box-sizing: border-box;
		// position: fixed;
		.place {
			height: calc(var(--status-bar-height) + 92rpx);
		}
		
		.topVue {
			width: 100%;
			// position: absolute;
			// left: 0;
			// top: 0;
			// z-index: 99;
			.status {
				width: 100%;
				height: var(--status-bar-height);
			}
			.navVue {
				width: 100%;
				height: 92rpx;
				background: linear-gradient(to right, #FFFBFF, #FFE7F4);
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 30rpx;
				.nav-title {
					width: 420rpx;
					height: 92rpx;
					font-size: 36rpx;
					color: #04094C;
					text-align: center;
					line-height: 92rpx;
				}
			}
		}
	}
</style>